package com.sxy.demo.sxy;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

@ApiModel
@Data
/**
 * select t.id as categoryId,t.`grade`,t.parent_id
 *         from (select `id`,
 *         `grade`,
 *         parent_id,
 *         `name`,
 *         SUBSTRING_INDEX(category_path, ',', 1) as
 *         rootId
 *         from rms_goods_platform_category
 *         where `deleted` =0 and `state` =1 and `grade` = 3
 *         <if test="@cn.hutool.core.collection.CollUtil@isNotEmpty(categoryIdList)">
 *             and `id` in
 *             <foreach collection="categoryIdList" item="item" index="index" open="(" separator="," close=")">
 *                 #{item}
 *             </foreach>
 *         </if>
 *         ) t left join rms_goods_platform_category l on t.rootId=l.id and l.`grade` = 1
 *         where l.name=#{categoryName}
 */
public class CategoryDTO {
    @ApiModelProperty(value = "类目ID")
    private Long categoryId;

    @ApiModelProperty(value = "类目编码")
    private String categoryCode;
    @ApiModelProperty(value = "类目名称")
    private String name;

    @ApiModelProperty(value = "类目ID 路径  三级类目的可以通过当前字段获取所有父级D")
    private String categoryPath;

    @ApiModelProperty(value = "完整类目名称 集合")
    private List<String> allCategoryName;

    private Long rootId;

    @ApiModelProperty(value = "等级 1:一级类目,2：二级类目,3:三级类目", allowableValues = "1,2,3")
    private String grade;

    @ApiModelProperty(value = "父级,为空表示为第一级")
    private Long parentId;

    @ApiModelProperty(value = "有效状态（状态 1-有效 0-无效）", allowableValues = "0,1")
    private String state;

    @ApiModelProperty(value = "是否是新健康商品")
    private Boolean healthGoods;
}
